<?php

/* ------------------------------------------------------------------------------------------------------------------------------------------------------ */

	add_filter( 'mce_external_plugins', "tinyplugin_register" );
	add_filter( 'mce_buttons', 'tinyplugin_add_button', 0 );

/* ------------------------------------------------------------------------------------------------------------------------------------------------------ */

	function tinyplugin_add_button($buttons)
	{
		array_push( $buttons, "separator", "tinyplugin" );
		
		return $buttons;
	}

	function tinyplugin_register( $plugin_array )
	{
		$url = get_template_directory_uri() . '/admin/editor_plugin.js';
	 
		$plugin_array["tinyplugin"] = $url;
		
		return $plugin_array;
	}

/* ------------------------------------------------------------------------------------------------------------------------------------------------------ */

?>